#include <iostream>



class student
{
public:
    student(int age, const std::string & name) : m_age(age), m_name(name)
    {
        std::cout << "妈惹法克\n";

    }

    void SetAge(int age)
    {
        m_age = age;
    }

    int GetAge()
    {
        return m_age;
    }

    void SetName(const std::string & name)//常引用，为了解决引用不能接右值的问题
    {
        m_name = name;
    }

    student(const student & A)
    {
        std::cout << "COPY" << std::endl;
        m_name = A.m_name;
        m_age = A.m_age;
    }
    std::string GetName();
    void operator=(const student & s)
    {
        std::cout << "赋值运算符重载函数" << std::endl;
    }

    ~student()
    {
        std::cout << "~~~~~~~" << std::endl;
    }
private:
    int m_age;
    std::string m_name;
};


int main()
{
    // student s(100, "操");
    // //s.SetAge(10);
    // std::cout << s.GetAge() << std::endl;
    // std::cout << s.GetName() << std::endl;
    // student A = s;
    // student S(23, "FUCK");
    // //studentA(s);
    // A = s;
    // S = s;
    // std::cout << S.GetAge() << std::endl;

    student* S = new student(100, "妈惹法克");
    delete S;
    return 0;
}

std::string student::GetName()
{
    return m_name;
}
